//引入Promise
var Promise = require('./es6-promise.auto.js');
//默认请求
function sendRequest(url, params,successFun) {
  let promisevariable = new Promise(function (resolve, reject) {
    wx.request({
      url: url,
      data: params,
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: successFun
    });
  });
  return promisevariable;
}



//暴露公共访问接口
module.exports = {
  sendRequest: sendRequest//公布公共请求接口
}